package cn.stylefeng.guns.modular.gridsystem.controller;

import cn.stylefeng.guns.core.annotion.BusinessLog;
import cn.stylefeng.guns.core.enums.LogAnnotionOpTypeEnum;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import cn.stylefeng.guns.modular.gridsystem.service.BizUploadQueueLogService;
import cn.stylefeng.guns.modular.gridsystem.model.param.BizUploadQueueLogParam;
import javax.annotation.Resource;

/**
 * 网关上报分数表 控制器
 *
 * @author: ssy
 * @date: 2021/11/02 18:06
 */
@RestController
public class BizUploadQueueLogController {

    @Resource
    private BizUploadQueueLogService bizUploadQueueLogService;

    /**
     * 分页查询网关上报分数表
     *
     * @author ssy
     * @date 2021/11/02 18:06
     */
    @GetMapping("/bizUploadQueueLog/page")
    @BusinessLog(title = "网关上报分数表_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData page(BizUploadQueueLogParam bizUploadQueueLogParam) {
        return new SuccessResponseData(bizUploadQueueLogService.pageList(bizUploadQueueLogParam));
    }

    /**
     * 获取全部网关上报分数表
     *
     * @author ssy
     * @date 2021/11/02 18:06
     */
    @GetMapping("/bizUploadQueueLog/list")
    @BusinessLog(title = "网关上报分数表_查询所有", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list( ) {
        return new SuccessResponseData(bizUploadQueueLogService.list());
    }

    /**
     * 查看详情网关上报分数表
     *
     * @author ssy
     * @date 2021/11/02 18:06
     */
    @GetMapping("/bizUploadQueueLog/detail")
    @BusinessLog(title = "网关上报分数表_查看详情", opType = LogAnnotionOpTypeEnum.DETAIL)
    public ResponseData detail(@Validated(BizUploadQueueLogParam.detail.class) BizUploadQueueLogParam bizUploadQueueLogParam) {
        return new SuccessResponseData(bizUploadQueueLogService.detail(bizUploadQueueLogParam));
    }

    /**
     * 添加网关上报分数表
     *
     * @author ssy
     * @date 2021/11/02 18:06
     */
    @PostMapping("/bizUploadQueueLog/add")
    @BusinessLog(title = "网关上报分数表_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(BizUploadQueueLogParam.add.class) BizUploadQueueLogParam bizUploadQueueLogParam) {
        bizUploadQueueLogService.add(bizUploadQueueLogParam);
        return new SuccessResponseData();
    }

    /**
     * 删除网关上报分数表
     *
     * @author ssy
     * @date 2021/11/02 18:06
     */
    @PostMapping("/bizUploadQueueLog/delete")
    @BusinessLog(title = "网关上报分数表_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    public ResponseData delete(@RequestBody @Validated(BizUploadQueueLogParam.delete.class) BizUploadQueueLogParam bizUploadQueueLogParam) {
        bizUploadQueueLogService.delete(bizUploadQueueLogParam);
        return new SuccessResponseData();
    }

    /**
     * 编辑网关上报分数表
     *
     * @author ssy
     * @date 2021/11/02 18:06
     */
    @PostMapping("/bizUploadQueueLog/edit")
    @BusinessLog(title = "网关上报分数表_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    public ResponseData edit(@RequestBody @Validated(BizUploadQueueLogParam.edit.class) BizUploadQueueLogParam bizUploadQueueLogParam) {
        bizUploadQueueLogService.edit(bizUploadQueueLogParam);
        return new SuccessResponseData();
    }


}
